include("include/connect.php"); //include("include/header.php"); Header called below so that Title will include Category of Item name //initialize variables $result_array = array(); $PHP_SELF = $_SERVER['PHP_SELF']; // specific listing_id If (isset($_GET["lid"])) { $lid = ($_GET["lid"]); } // category id If (isset($_GET["cid"])) { $cid = ($_GET["cid"]); } //$lid = ($_GET["lid"]); // specific listing_id //$cid = ($_GET["cid"]); // category id $pic_not_available = "pic_not_available.png"; //$images_dir = "pics/"; // this is seperated from the images folder --- PLACED in CONNECT.php $x = 0; // counter var //if(empty($cid) && empty($lid)){echo "empty";} /******************************** BEGIN SHOW ENTIRE CATEGORY *************************************/ //Query database for category if(!empty($cid) && empty($lid)){ $sql="SELECT * FROM $listing_category_table WHERE category_id = '$cid' ";//select all the fields from the table $result = @mysqli_query($connection,$sql);// or die(mysql_error());//query database while($row=mysqli_fetch_array($result)){//while loop to go through each field in the table $page_title=$row['category']; } include("include/header.php"); $sql="SELECT * FROM $listing_item_table WHERE category_id = '$cid' ";//select all the fields from the table $result = @mysqli_query($connection,$sql);// or die(mysql_error());//query database $nr = mysqli_num_rows($result); while($row=mysqli_fetch_array($result)){//while loop to go through each field in the table $lid=$row['listing_id']; $item=$row['item']; // $itemdashes=str_replace(' ', '-', strtolower($row['item'])); $itemdashes=str_replace(array(' ',','),'-', strtolower($row['item'])); //removes commas and spaces from the Item Title $category_id=$row['category_id']; // $tag=$row['tag']; $price=$row['price']; $description=$row['description']; //Get the Category for the Category_ID Listing $sql="SELECT * FROM $listing_category_table WHERE category_id = '$category_id' ";//select all the fields from the table $result_category = @mysqli_query($connection,$sql);// or die(mysql_error());//query database while($row=mysqli_fetch_array($result_category)){//while loop to go through each field in the table $category=$row['category']; } // Got the Category now $photo_filename='';// null the picture so the previous is not displayed $sql="SELECT * FROM $listing_photos_table WHERE tag= '$lid' ORDER BY photo_id DESC ";//selectall the fields from the table $result_img = @mysqli_query($connection,$sql);// or die(mysql_error());//query database while($row=mysqli_fetch_array($result_img)){//while loop to go through each field in the table $photo_id=$row['photo_id']; //don't think this is used $photo_filename=$row['photo_filename']; } //end while $result_img // All Items in category found, display results ?>
|
"> See More Pictures |
echo "$item"; ?>Category: echo "$category"; ?> Price: echo "$price"; ?> Description: echo "$description"; ?> |
Edit';}; ?> |
Edit';}; ?>
Select + next to little pic to see the BIG picture
" name="PhotoBig" width="500px" style="border:1px solid black;" Title=" echo "$item - Category: $category"; ?>" Alt=" echo "$item - Category: $category"; ?>">
Price: echo "$price"; ?>
Description: echo "$description"; ?>
$lid .= ".html"; }// end while array // nothing found, display message if(empty($nr)) { $page_title = "Item is Not Found"; include("include/header.php"); echo "Remember, we help find specific items requested by customers on a regular basis. So, if you do not see what you are looking for within these featured items, please contact us and we'll help you find it.
$sql="SELECT * FROM $listing_item_table ORDER BY category_id ASC ";//select all the fields from the table $result = @mysqli_query($connection,$sql);// or die(mysqli_error());//query database $nr = mysqli_num_rows($result); while($row=mysqli_fetch_array($result)){//while loop to go through each field in the table $lid=$row['listing_id']; $item=$row['item']; $category_id=$row['category_id']; // $tag=$row['tag']; $price=$row['price']; $description=$row['description']; //Get the Category for the Category_ID Listing $sql="SELECT * FROM $listing_category_table WHERE category_id = '$category_id' ";//select all the fields from the table $result_category = @mysqli_query($connection,$sql) or die(mysql_error());//query database while($row=mysqli_fetch_array($result_category)){//while loop to go through each field in the table $category=$row['category']; } // Got the Category now $photo_filename='';// null the picture so the previous is not displayed $sql="SELECT * FROM $listing_photos_table WHERE tag= '$lid' ORDER BY photo_id DESC ";//selectall the fields from the table $result_img = @mysqli_query($connection,$sql) or die(mysql_error());//query database while($row=mysqli_fetch_array($result_img)){//while loop to go through each field in the table $photo_id=$row['photo_id']; //don't think this is used $photo_filename=$row['photo_filename']; } //end while $result_img // All Items Retrieved, display results ?>|
"> See More Pictures |
echo "$item"; ?>Category: echo "$category"; ?> Price: echo "$price"; ?> Description: echo "$description"; ?> |
Edit';}; ?> |